﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if
end Function



Function index
	dim rs,sql,Runtxt
	Runtxt=qingtian.RunStr
%>
	<card title="添加新版主"><p align="left">

	用户ID：<br/>
	<input emptyok="true"  name="nid<%=Runtxt%>" maxlength="10" format="*N" value="" type="text"/><br/>
	<%
		Dim sql1,rs1,i
		set rs1=server.CreateObject("adodb.recordset")
		sql1="select * from qingtian_bbs WHERE [del]=0 and [view]=0   order by class asc"
		Rs1.Open Sql1,conn,1,1
		if not (rs1.bof and rs1.eof)  then
		%>
 		论坛版块:<select name="listid<%=Runtxt%>"  value="<%=rs1("id")%>">
		<%
			For i=1 to rs1.RecordCount
				If Rs1.Eof Then
					exit For
				End If
				%><option value="<%=rs1("id")%>"><%=qingtian.utf8(rs1("name"))%></option><%
				Rs1.MoveNext
			Next
		else
		%>
 		论坛版块:<select name="listid<%=Runtxt%>"  value="0">
		<%
		Rs1.close
		set rs1=nothing
		end if
	%></select><br/>
 	版主类型:<select name="cbz<%=Runtxt%>"  value="false">
	<option value="false">论坛版主</option>
	<option value="true">论坛副版主</option>
	</select><br/>
	<anchor>确定提交
    	<go href="?Action=login&amp;sid=<%=sid%>" method='post'>
        <postfield name="nid" value="$(nid<%=Runtxt%>)"/>
        <postfield name="listid" value="$(listid<%=Runtxt%>)"/>
        <postfield name="cbz" value="$(cbz<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>

-------------<br/>
<a href='bbsbz.asp?sid=<%=sid%>'>返回版主管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
End Function


Function login

		dim nid,cbz,listid,rs,sql,errs
		nid=Request.form("nid")
		cbz=Request.form("cbz")
 		listid=Request.form("listid")



		errs=""
		if nid="" or Not IsNumeric(nid)  then errs=errs & "用户ID不能为空<br/>"
		if cbz="" then errs=errs & "请选择版主类型<br/>"
		if listid="" then errs=errs & "请选择论坛版块<br/>"


	%>
	<card id="login" title="添加新版主" ontimer="bbsbz.asp?sid=<%=sid%>"><timer value="20"/>
		<p align="left">
	<%
	IF len(errs)=0 then


		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select  * FROM qingtian_bbs_bz"
		rs.open sql,conn,1,3
		rs.addnew
			rs("nid")=nid
			rs("listid")=listid
			rs("class")=cbz
		rs.update()

		rs.Close
		Set rs = Nothing
		%>添加新版主成功!<br/><%

	else%>
		<%=errs%>
		<a href="?sid=<%=sid%>">返回修改</a><br/>
<%	end if
%>
<a href='bbsbz.asp?sid=<%=sid%>'>返回版主管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
